package 设计模式;

//静态内部类
public class SingletonDemo5 {

    private SingletonDemo5(){}

    private static class SingletonFactory{
        private static SingletonDemo5 instance = new SingletonDemo5();
    }

    public static SingletonDemo5 getInstance(){
        return SingletonFactory.instance;
    }

}
